#coding=utf-8
'''
Naming a Slice
'''
record = '....................100          .......513.25  ..........'
SHARES = slice(20, 32)
PRICE = slice(40, 48)
cost = int(record[SHARES]) * float(record[PRICE])
print(cost)


## Part2
items = [0, 1, 2, 3, 4, 5, 6]
a = slice(2, 4)
print(items[2: 4])
print(items[a])
items[a] = [10, 11]
print(items)
del items[a]
print(items)

## Part 3 s.start ,  s.stop , and  s.step attributes,
a = slice(10, 50, 2)
print(a.start)
print(a.stop)
print(a.step)

## Part 4
s = 'HelloWorld'
print(a.indices(len(s)))
for i in range(*a.indices(len(s))):
    print(s[i])
